<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ace="http://www.icefaces.org/icefaces/components"
	xmlns:ice="http://www.icesoft.com/icefaces/component"
	template="/WEB-INF/layout/layout.xhtml">
	
	<ui:param name="lawyerForm" value="#{lawyerController.lawyerForm}" /> 
	
	<ui:define name="title">Catalogo de Abogados</ui:define>
	<ui:define name="content">
		<ice:panelGroup style="padding-left:10px;padding-top:3px">
				<h:messages for="lawyerForm" showDetail="false" showSummary="true" style="color:red;margin:8px;"  layout="table" />
				<ice:form id="lawyerForm">
					<h:panelGrid columns="2" width="450"
						style="border: 1px solid #CDCDCD;">
						<h:outputLabel for="Id" value="Id:" />
						<h:inputText id="Id"
							value="#{lawyerForm.editLawyer.id}" disabled="true"
							size="15" maxlength="10">
							<f:validateLength minimum="1" maximum="10" />
						</h:inputText>
						<h:outputLabel for="description" value="Descripcion:" />
						<h:inputText id="description"
							value="#{lawyerForm.editLawyer.name}" 
							size="40" maxlength="80" />
						<f:facet name="footer">
							<h:panelGroup style="text-align:right;display:block">
							<h:commandButton value="Guardar"
								actionListener="#{lawyerController.submitLawyer}" />
							</h:panelGroup>
						</f:facet>
					</h:panelGrid>
				</ice:form>

				<!-- 						<ice:panelGroup style="width:100%;"> -->
				<!-- 							<ice:outputLabel value="Client Name:" size="50" /> -->
				<!-- 							<ice:inputText value="" /> -->
				<!-- 							<ice:commandButton value="Buscar" /> -->
				<!-- 						</ice:panelGroup> -->
				<ice:form>
					<ice:dataTable width="450"
						value="#{lawyerForm.lawyers}" var="lawyer">
						<ice:column>
		          		<f:facet name="header">
								<ice:outputText value="Id" />
							</f:facet>
							<ice:outputText value="#{lawyer.id}" />
						</ice:column>
						<ice:column>
							<f:facet name="header">
								<ice:outputText value="Name" />
							</f:facet>
							<ice:outputText value="#{lawyer.name}" />
						</ice:column>

						<ice:column>
							<f:facet name="header"></f:facet>
							<h:commandButton image="images/edit-page.png" alt="Edit"
								title="Edit" style="height: 11px; width: 11px;"
								action="#{lawyerController.editItem}">
								<f:setPropertyActionListener
									target="#{lawyerForm.toEdit}" value="#{lawyer.id}" />
							</h:commandButton>
						</ice:column>
						<ice:column>
							<f:facet name="header"></f:facet>
							<h:commandButton image="images/popup-close.png" alt="Delete"
								title="Delete" style="height: 11px; width: 11px;"
								action="#{lawyerController.removeItem}">
								<f:setPropertyActionListener
									target="#{lawyerForm.toRemove}"
									value="#{lawyer.id}" />
							</h:commandButton>
						</ice:column>
					</ice:dataTable>
				</ice:form>
			</ice:panelGroup>
	</ui:define>
</ui:composition>
